package com.gues.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.gues.eneity.Article;
import com.gues.mapper.ArticleMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ArticleService {

    @Resource
    ArticleMapper articleMapper;

    public List<Article> getArticleList() {
        QueryWrapper<Article> queryWrapper = new QueryWrapper<>();
        queryWrapper.select("id", "title", "abstracter", "url", "create_date", "view_num", "digg_num");
        return articleMapper.selectList(queryWrapper);
    }

    public Article getArticleById(Integer id) {
        return articleMapper.getArticleById(id);
    }

}
